package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.ServerDailyStats;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 服务器每日统计数据Mapper接口
 */
@Mapper
public interface ServerDailyStatsMapper extends BaseMapper<ServerDailyStats> {
    
    /**
     * 获取指定时间范围内的每日统计数据
     */
    @Select("SELECT * FROM server_daily_stats WHERE server_id = #{serverId} " +
            "AND stats_date BETWEEN DATE(#{startTime}) AND DATE(#{endTime}) " +
            "ORDER BY stats_date ASC")
    List<ServerDailyStats> getStatsByTimeRange(Long serverId, LocalDateTime startTime, LocalDateTime endTime);
} 